<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" charset="utf-8" src="/My97DatePicker/WdatePicker.js"></script>

<style>
    #login-button{
        background: #286090!important;
        color: white!important;
        border: 1px solid #286090!important;
        border-radius: 3px;
    }
</style>
<div class="span10">
    <div style="margin-bottom: 20px;">
        <a href="/index/index">首页</a>
        <span >&gt;</span>
        <span>考场位置</span>
        <span >&gt;</span>
        <span>添加</span>
    </div>
    <form class="form" method="post" action="<?php echo baseUrl."/content/examroom/add"?>" enctype="multipart/form-data">
        <table>
            <tr>
                <td>考场编号 *</td>
                <td ><input type="text" style="width: 600px;" name="code" placeholder="" value="<?php echo isset($data)? $data['code']:''?>"/></td>
            </tr>
            <tr>
                <td>考场名称 *</td>
                <td ><input type="text" style="width: 600px;" name="name" placeholder="" value="<?php echo isset($data)? $data['name']:''?>"/></td>
            </tr>
            <?php if(isset($data)) {
                $str = '<tr>';
                $str .= '<td>原图片:</td>';
                $str .= '<td>';
                $pic = $data['pic'];
                $str .= "<input name='pic' type='text' value='" . $pic . "'></td></tr>";
                echo $str;
            } ?>

            <tr>
                <td width="120px">上传、修改图片 *:</td>
                <td>
                    <input id="file" type="file" name="pic" >
                </td>
            </tr>
            <tr>
                <td>地区 *</td>
                <td>
                    <select name="area" id="area" >
                        <option value ="">请选择类型</option>
                        <option value ="1" <?php echo isset($data)&& $data['area']=="1" ?  'selected=selected':''?>>华东</option>
                        <option value ="2" <?php echo isset($data)&& $data['area']=="2" ?  'selected=selected':''?>>华南</option>
                        <option value ="3" <?php echo isset($data)&& $data['area']=="3" ?  'selected=selected':''?>>华中</option>
                        <option value ="4" <?php echo isset($data)&& $data['area']=="4" ?  'selected=selected':''?>>华北</option>
                        <option value ="5" <?php echo isset($data)&& $data['area']=="5" ?  'selected=selected':''?>>西北</option>
                        <option value ="6" <?php echo isset($data)&& $data['area']=="6" ?  'selected=selected':''?>>西南</option>
                        <option value ="7" <?php echo isset($data)&& $data['area']=="7" ?  'selected=selected':''?>>东北</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>省 *</td>
                <td ><input type="text" style="width: 600px;" name="province" placeholder="" value="<?php echo isset($data)? $data['province']:''?>"/></td>
            </tr>
            <tr>
                <td>城市 *</td>
                <td ><input type="text" style="width: 600px;" name="city" placeholder="" value="<?php echo isset($data)? $data['city']:''?>"/></td>
            </tr>
            <tr>
                <td>地址 *</td>
                <td ><input type="text" style="width: 600px;" name="address" placeholder="" value="<?php echo isset($data)? $data['address']:''?>"/></td>
            </tr>
            <tr>
                <td>笔试考场 *</td>
                <td ><input type="text" style="width: 600px;" name="writtenExam" placeholder="" value="<?php echo isset($data)? $data['writtenExam']:''?>"/></td>
            </tr> <tr>
                <td>口语考场 *</td>
                <td ><input type="text" style="width: 600px;" name="spokenExam" placeholder="" value="<?php echo isset($data)? $data['spokenExam']:''?>"/></td>
            </tr>
            <tr>
                <td>电话 *</td>
                <td ><input type="text" style="width: 600px;" name="phone" placeholder="" value="<?php echo isset($data)? $data['phone']:''?>"/></td>
            </tr>
            <tr>
                <td>交通 *</td>
                <td ><input type="text" style="width: 600px;" name="traffic" placeholder="" value="<?php echo isset($data)? $data['traffic']:''?>"/></td>
            </tr>
            <tr>
                <td>链接url *</td>
                <td ><input type="text" style="width: 600px;" name="urlcode" placeholder="02114  注释：021上海区号14考号" value="<?php echo isset($data)? $data['urlcode']:''?>"/></td>
            </tr>
            <tr>
                <td colspan="2" align="center"> <button type="submit" id="login-button">添加考场</button></td>
            </tr>
            <input type="hidden" name='id' value="<?php echo isset($data)? $data['id']:''?>"/>
            <input type="hidden" name="_csrf" value="<?=Yii::$app->request->getCsrfToken()?>" />
        </table>
    </form>
</div>
<script>
    //实例化编辑器
    var ue = UE.getEditor('editor');
    var plan = UE.getEditor('plan');
    var intro = UE.getEditor('intro');
</script>